<!DOCTYPE html>

<html>
<head>
  <title>convert.coffee</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
  <div id="container">
    <div id="background"></div>
    
      <ul id="jump_to">
        <li>
          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
          <a class="small" href="javascript:void(0);">+</a>
          <div id="jump_wrapper">
          <div id="jump_page">
            
              
              <a class="source" href="analyze.html">
                analyze.coffee
              </a>
            
              
              <a class="source" href="autoload.html">
                autoload.coffee
              </a>
            
              
              <a class="source" href="blender.html">
                blender.coffee
              </a>
            
              
              <a class="source" href="calculate.html">
                calculate.coffee
              </a>
            
              
              <a class="source" href="caman.html">
                caman.coffee
              </a>
            
              
              <a class="source" href="convert.html">
                convert.coffee
              </a>
            
              
              <a class="source" href="event.html">
                event.coffee
              </a>
            
              
              <a class="source" href="filter.html">
                filter.coffee
              </a>
            
              
              <a class="source" href="io.html">
                io.coffee
              </a>
            
              
              <a class="source" href="layer.html">
                layer.coffee
              </a>
            
              
              <a class="source" href="logger.html">
                logger.coffee
              </a>
            
              
              <a class="source" href="module.html">
                module.coffee
              </a>
            
              
              <a class="source" href="pixel.html">
                pixel.coffee
              </a>
            
              
              <a class="source" href="plugin.html">
                plugin.coffee
              </a>
            
              
              <a class="source" href="renderer.html">
                renderer.coffee
              </a>
            
              
              <a class="source" href="store.html">
                store.coffee
              </a>
            
              
              <a class="source" href="util.html">
                util.coffee
              </a>
            
              
              <a class="source" href="blenders.html">
                blenders.coffee
              </a>
            
              
              <a class="source" href="filters.html">
                filters.coffee
              </a>
            
              
              <a class="source" href="size.html">
                size.coffee
              </a>
            
              
              <a class="source" href="blur.html">
                blur.coffee
              </a>
            
              
              <a class="source" href="camera.html">
                camera.coffee
              </a>
            
              
              <a class="source" href="compoundBlur.html">
                compoundBlur.coffee
              </a>
            
              
              <a class="source" href="edges.html">
                edges.coffee
              </a>
            
              
              <a class="source" href="posterize.html">
                posterize.coffee
              </a>
            
              
              <a class="source" href="presets.html">
                presets.coffee
              </a>
            
              
              <a class="source" href="rotate.html">
                rotate.coffee
              </a>
            
              
              <a class="source" href="stackBlur.html">
                stackBlur.coffee
              </a>
            
              
              <a class="source" href="threshold.html">
                threshold.coffee
              </a>
            
          </div>
        </li>
      </ul>
    
    <ul class="sections">
        
          <li id="title">
              <div class="annotation">
                  <h1>convert.coffee</h1>
              </div>
          </li>
        
        
        
        <li id="section-1">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-1">&#182;</a>
              </div>
              <p>Tons of color conversion utility functions.</p>

            </div>
            
            <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">class</span> <span class="title">Caman</span>.<span class="title">Convert</span></span></pre></div></div>
            
        </li>
        
        
        <li id="section-2">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-2">&#182;</a>
              </div>
              <p>Converts the hex representation of a color to RGB values.
Hex value can optionally start with the hash (#).</p>
<p>@param  [String] hex  The colors hex value
@return [Array]       The RGB representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@hexToRGB</span>: (hex) -&gt;
    hex = hex.substr(<span class="number">1</span>) <span class="keyword">if</span> hex.charAt(<span class="number">0</span>) <span class="keyword">is</span> <span class="string">"#"</span>
    r = parseInt hex.substr(<span class="number">0</span>, <span class="number">2</span>), <span class="number">16</span>
    g = parseInt hex.substr(<span class="number">2</span>, <span class="number">2</span>), <span class="number">16</span>
    b = parseInt hex.substr(<span class="number">4</span>, <span class="number">2</span>), <span class="number">16</span>

    r: r, g: g, b: b</pre></div></div>
            
        </li>
        
        
        <li id="section-3">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-3">&#182;</a>
              </div>
              <p>Converts an RGB color to HSL.
Assumes r, g, and b are in the set [0, 255] and
returns h, s, and l in the set [0, 1].</p>
<p>@overload rgbToHSL(r, g, b)
  @param   [Number]  r   Red channel
  @param   [Number]  g   Green channel
  @param   [Number]  b   Blue channel</p>
<p>@overload rgbToHSL(rgb)
  @param [Object] rgb The RGB object.
  @option rgb [Number] r The red channel.
  @option rgb [Number] g The green channel.
  @option rgb [Number] b The blue channel.</p>
<p>@return  [Array]       The HSL representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@rgbToHSL</span>: (r, g, b) -&gt;
    <span class="keyword">if</span> <span class="keyword">typeof</span> r <span class="keyword">is</span> <span class="string">"object"</span>
      g = r.g
      b = r.b
      r = r.r

    r /= <span class="number">255</span>
    g /= <span class="number">255</span>
    b /= <span class="number">255</span>

    max = Math.max r, g, b
    min = Math.min r, g, b
    l = (max + min) / <span class="number">2</span>

    <span class="keyword">if</span> max <span class="keyword">is</span> min
      h = s = <span class="number">0</span>
    <span class="keyword">else</span>
      d = max - min
      s = <span class="keyword">if</span> l &gt; <span class="number">0.5</span> <span class="keyword">then</span> d / (<span class="number">2</span> - max - min) <span class="keyword">else</span> d / (max + min)
      h = <span class="keyword">switch</span> max
        <span class="keyword">when</span> r <span class="keyword">then</span> (g - b) / d + (<span class="keyword">if</span> g &lt; b <span class="keyword">then</span> <span class="number">6</span> <span class="keyword">else</span> <span class="number">0</span>)
        <span class="keyword">when</span> g <span class="keyword">then</span> (b - r) / d + <span class="number">2</span>
        <span class="keyword">when</span> b <span class="keyword">then</span> (r - g) / d + <span class="number">4</span>
      
      h /= <span class="number">6</span>

    h: h, s: s, l: l</pre></div></div>
            
        </li>
        
        
        <li id="section-4">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-4">&#182;</a>
              </div>
              <p>Converts an HSL color value to RGB. Conversion formula
adapted from <a href="http://en.wikipedia.org/wiki/HSL_color_space">http://en.wikipedia.org/wiki/HSL_color_space</a>.
Assumes h, s, and l are contained in the set [0, 1] and
returns r, g, and b in the set [0, 255].</p>
<p>@overload hslToRGB(h, s, l)
  @param   [Number]  h       The hue
  @param   [Number]  s       The saturation
  @param   [Number]  l       The lightness</p>
<p>@overload hslToRGB(hsl)
  @param [Object] hsl The HSL object.
  @option hsl [Number] h The hue.
  @option hsl [Number] s The saturation.
  @option hsl [Number] l The lightness.</p>
<p>@return  [Array]           The RGB representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@hslToRGB</span>: (h, s, l) -&gt;
    <span class="keyword">if</span> <span class="keyword">typeof</span> h <span class="keyword">is</span> <span class="string">"object"</span>
      s = h.s
      l = h.l
      h = h.h

    <span class="keyword">if</span> s <span class="keyword">is</span> <span class="number">0</span>
      r = g = b = l
    <span class="keyword">else</span>
      q = <span class="keyword">if</span> l &lt; <span class="number">0.5</span> <span class="keyword">then</span> l * (<span class="number">1</span> + s) <span class="keyword">else</span> l + s - l * s
      p = <span class="number">2</span> * l - q
      
      r = <span class="property">@hueToRGB</span> p, q, h + <span class="number">1</span>/<span class="number">3</span>
      g = <span class="property">@hueToRGB</span> p, q, h
      b = <span class="property">@hueToRGB</span> p, q, h - <span class="number">1</span>/<span class="number">3</span>

    r: r * <span class="number">255</span>, g: g * <span class="number">255</span>, b: b * <span class="number">255</span></pre></div></div>
            
        </li>
        
        
        <li id="section-5">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-5">&#182;</a>
              </div>
              <p>Converts from the hue color space back to RGB.</p>
<p>@param [Number] p
@param [Number] q
@param [Number] t
@return [Number] RGB value</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@hueToRGB</span>: (p, q, t) -&gt;
    <span class="keyword">if</span> t &lt; <span class="number">0</span> <span class="keyword">then</span> t += <span class="number">1</span>
    <span class="keyword">if</span> t &gt; <span class="number">1</span> <span class="keyword">then</span> t -= <span class="number">1</span>
    <span class="keyword">if</span> t &lt; <span class="number">1</span>/<span class="number">6</span> <span class="keyword">then</span> <span class="keyword">return</span> p + (q - p) * <span class="number">6</span> * t
    <span class="keyword">if</span> t &lt; <span class="number">1</span>/<span class="number">2</span> <span class="keyword">then</span> <span class="keyword">return</span> q
    <span class="keyword">if</span> t &lt; <span class="number">2</span><span class="regexp">/3 then return p + (q - p) * (2/</span><span class="number">3</span> - t) * <span class="number">6</span>
    <span class="keyword">return</span> p</pre></div></div>
            
        </li>
        
        
        <li id="section-6">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-6">&#182;</a>
              </div>
              <p>Converts an RGB color value to HSV. Conversion formula
adapted from {<a href="http://en.wikipedia.org/wiki/HSV_color_space}">http://en.wikipedia.org/wiki/HSV_color_space}</a>.
Assumes r, g, and b are contained in the set [0, 255] and
returns h, s, and v in the set [0, 1].</p>
<p>@param   [Number]  r       The red color value
@param   [Number]  g       The green color value
@param   [Number]  b       The blue color value
@return  [Array]           The HSV representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@rgbToHSV</span>: (r, g, b) -&gt;
    r /= <span class="number">255</span>
    g /= <span class="number">255</span>
    b /= <span class="number">255</span>

    max = Math.max r, g, b
    min = Math.min r, g, b
    v = max
    d = max - min

    s = <span class="keyword">if</span> max <span class="keyword">is</span> <span class="number">0</span> <span class="keyword">then</span> <span class="number">0</span> <span class="keyword">else</span> d / max

    <span class="keyword">if</span> max <span class="keyword">is</span> min
      h = <span class="number">0</span>
    <span class="keyword">else</span>
      h = <span class="keyword">switch</span> max
        <span class="keyword">when</span> r <span class="keyword">then</span> (g - b) / d + (<span class="keyword">if</span> g &lt; b <span class="keyword">then</span> <span class="number">6</span> <span class="keyword">else</span> <span class="number">0</span>)
        <span class="keyword">when</span> g <span class="keyword">then</span> (b - r) / d + <span class="number">2</span>
        <span class="keyword">when</span> b <span class="keyword">then</span> (r - g) / d + <span class="number">4</span>

      h /= <span class="number">6</span>

    h: h, s: s, v: v</pre></div></div>
            
        </li>
        
        
        <li id="section-7">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-7">&#182;</a>
              </div>
              <p>Converts an HSV color value to RGB. Conversion formula
adapted from <a href="http://en.wikipedia.org/wiki/HSV_color_space">http://en.wikipedia.org/wiki/HSV_color_space</a>.
Assumes h, s, and v are contained in the set [0, 1] and
returns r, g, and b in the set [0, 255].</p>
<p>@param   [Number]  h       The hue
@param   [Number]  s       The saturation
@param   [Number]  v       The value
@return  [Array]           The RGB representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@hsvToRGB</span>: (h, s, v) -&gt;
    i = Math.floor h * <span class="number">6</span>
    f = h * <span class="number">6</span> - i
    p = v * (<span class="number">1</span> - s)
    q = v * (<span class="number">1</span> - f * s)
    t = v * (<span class="number">1</span> - (<span class="number">1</span> - f) * s)

    <span class="keyword">switch</span> i % <span class="number">6</span>
      <span class="keyword">when</span> <span class="number">0</span> <span class="keyword">then</span> r = v; g = t; b = p
      <span class="keyword">when</span> <span class="number">1</span> <span class="keyword">then</span> r = q; g = v; b = p
      <span class="keyword">when</span> <span class="number">2</span> <span class="keyword">then</span> r = p; g = v; b = t
      <span class="keyword">when</span> <span class="number">3</span> <span class="keyword">then</span> r = p; g = q; b = v
      <span class="keyword">when</span> <span class="number">4</span> <span class="keyword">then</span> r = t; g = p; b = v
      <span class="keyword">when</span> <span class="number">5</span> <span class="keyword">then</span> r = v; g = p; b = q

    r: Math.floor(r * <span class="number">255</span>)
    g: Math.floor(g * <span class="number">255</span>)
    b: Math.floor(b * <span class="number">255</span>)</pre></div></div>
            
        </li>
        
        
        <li id="section-8">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-8">&#182;</a>
              </div>
              <p>Converts a RGB color value to the XYZ color space. Formulas
are based on <a href="http://en.wikipedia.org/wiki/SRGB">http://en.wikipedia.org/wiki/SRGB</a> assuming that
RGB values are sRGB.</p>
<p>Assumes r, g, and b are contained in the set [0, 255] and
returns x, y, and z.</p>
<p>@param   [Number]  r       The red color value
@param   [Number]  g       The green color value
@param   [Number]  b       The blue color value
@return  [Array]           The XYZ representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@rgbToXYZ</span>: (r, g, b) -&gt;
    r /= <span class="number">255</span>
    g /= <span class="number">255</span>
    b /= <span class="number">255</span>

    <span class="keyword">if</span> r &gt; <span class="number">0.04045</span>
      r = Math.pow((r + <span class="number">0.055</span>) / <span class="number">1.055</span>, <span class="number">2.4</span>)
    <span class="keyword">else</span>
      r /= <span class="number">12.92</span>

    <span class="keyword">if</span> g &gt; <span class="number">0.04045</span>
      g = Math.pow((g + <span class="number">0.055</span>) / <span class="number">1.055</span>, <span class="number">2.4</span>)
    <span class="keyword">else</span>
      g /= <span class="number">12.92</span>

    <span class="keyword">if</span> b &gt; <span class="number">0.04045</span>
      b = Math.pow((b + <span class="number">0.055</span>) / <span class="number">1.055</span>, <span class="number">2.4</span>)
    <span class="keyword">else</span>
      b /= <span class="number">12.92</span>

    x = r * <span class="number">0.4124</span> + g * <span class="number">0.3576</span> + b * <span class="number">0.1805</span>;
    y = r * <span class="number">0.2126</span> + g * <span class="number">0.7152</span> + b * <span class="number">0.0722</span>;
    z = r * <span class="number">0.0193</span> + g * <span class="number">0.1192</span> + b * <span class="number">0.9505</span>;
  
    x: x * <span class="number">100</span>, y: y * <span class="number">100</span>, z: z * <span class="number">100</span></pre></div></div>
            
        </li>
        
        
        <li id="section-9">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-9">&#182;</a>
              </div>
              <p>Converts a XYZ color value to the sRGB color space. Formulas
are based on <a href="http://en.wikipedia.org/wiki/SRGB">http://en.wikipedia.org/wiki/SRGB</a> and the resulting
RGB value will be in the sRGB color space.
Assumes x, y and z values are whatever they are and returns
r, g and b in the set [0, 255].</p>
<p>@param   [Number]  x       The X value
@param   [Number]  y       The Y value
@param   [Number]  z       The Z value
@return  [Array]           The RGB representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@xyzToRGB</span>: (x, y, z) -&gt;
    x /= <span class="number">100</span>
    y /= <span class="number">100</span>
    z /= <span class="number">100</span>

    r = (<span class="number">3.2406</span>  * x) + (-<span class="number">1.5372</span> * y) + (-<span class="number">0.4986</span> * z)
    g = (-<span class="number">0.9689</span> * x) + (<span class="number">1.8758</span>  * y) + (<span class="number">0.0415</span>  * z)
    b = (<span class="number">0.0557</span>  * x) + (-<span class="number">0.2040</span> * y) + (<span class="number">1.0570</span>  * z)

    <span class="keyword">if</span> r &gt; <span class="number">0.0031308</span>
      r = (<span class="number">1.055</span> * Math.pow(r, <span class="number">0.4166666667</span>)) - <span class="number">0.055</span>
    <span class="keyword">else</span>
      r *= <span class="number">12.92</span>

    <span class="keyword">if</span> g &gt; <span class="number">0.0031308</span>
      g = (<span class="number">1.055</span> * Math.pow(g, <span class="number">0.4166666667</span>)) - <span class="number">0.055</span>
    <span class="keyword">else</span>
      g *= <span class="number">12.92</span>

    <span class="keyword">if</span> b &gt; <span class="number">0.0031308</span>
      b = (<span class="number">1.055</span> * Math.pow(b, <span class="number">0.4166666667</span>)) - <span class="number">0.055</span>
    <span class="keyword">else</span>
      b *= <span class="number">12.92</span>

    r: r * <span class="number">255</span>, g: g * <span class="number">255</span>, b: b * <span class="number">255</span></pre></div></div>
            
        </li>
        
        
        <li id="section-10">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-10">&#182;</a>
              </div>
              <p>Converts a XYZ color value to the CIELAB color space. Formulas
are based on <a href="http://en.wikipedia.org/wiki/Lab_color_space">http://en.wikipedia.org/wiki/Lab_color_space</a>
The reference white point used in the conversion is D65.
Assumes x, y and z values are whatever they are and returns
L<em>, a</em> and b* values</p>
<p>@overload xyzToLab(x, y, z)
  @param   [Number]  x       The X value
  @param   [Number]  y       The Y value
  @param   [Number]  z       The Z value</p>
<p>@overload xyzToLab(xyz)
  @param [Object] xyz The XYZ object.
  @option xyz [Number] x The X value.
  @option xyz [Number] y The Y value.
  @option xyz [Number] z The z value.</p>
<p>@return [Array] The Lab representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@xyzToLab</span>: (x, y, z) -&gt;
    <span class="keyword">if</span> <span class="keyword">typeof</span> x <span class="keyword">is</span> <span class="string">"object"</span>
      y = x.y
      z = x.z
      x = x.x

    whiteX = <span class="number">95.047</span>
    whiteY = <span class="number">100.0</span>
    whiteZ = <span class="number">108.883</span>

    x /= whiteX
    y /= whiteY
    z /= whiteZ

    <span class="keyword">if</span> x &gt; <span class="number">0.008856451679</span>
      x = Math.pow(x, <span class="number">0.3333333333</span>)
    <span class="keyword">else</span>
      x = (<span class="number">7.787037037</span> * x) + <span class="number">0.1379310345</span>
  
    <span class="keyword">if</span> y &gt; <span class="number">0.008856451679</span>
      y = Math.pow(y, <span class="number">0.3333333333</span>)
    <span class="keyword">else</span>
      y = (<span class="number">7.787037037</span> * y) + <span class="number">0.1379310345</span>
  
    <span class="keyword">if</span> z &gt; <span class="number">0.008856451679</span>
      z = Math.pow(z, <span class="number">0.3333333333</span>)
    <span class="keyword">else</span>
      z = (<span class="number">7.787037037</span> * z) + <span class="number">0.1379310345</span>

    l = <span class="number">116</span> * y - <span class="number">16</span>
    a = <span class="number">500</span> * (x - y)
    b = <span class="number">200</span> * (y - z)

    l: l, a: a, b: b</pre></div></div>
            
        </li>
        
        
        <li id="section-11">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-11">&#182;</a>
              </div>
              <p>Converts a L<em>, a</em>, b* color values from the CIELAB color space
to the XYZ color space. Formulas are based on
<a href="http://en.wikipedia.org/wiki/Lab_color_space">http://en.wikipedia.org/wiki/Lab_color_space</a></p>
<p>The reference white point used in the conversion is D65.
Assumes L<em>, a</em> and b* values are whatever they are and returns
x, y and z values.</p>
<p>@overload labToXYZ(l, a, b)
  @param   [Number]  l       The L<em> value
  @param   [Number]  a       The a</em> value
  @param   [Number]  b       The b* value</p>
<p>@overload labToXYZ(lab)
  @param [Object] lab The LAB values
  @option lab [Number] l The L<em> value.
  @option lab [Number] a The a</em> value.
  @option lab [Number] b The b* value.</p>
<p>@return  [Array]           The XYZ representation</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@labToXYZ</span>: (l, a, b) -&gt;
    <span class="keyword">if</span> <span class="keyword">typeof</span> l <span class="keyword">is</span> <span class="string">"object"</span>
      a = l.a
      b = l.b
      l = l.l

    y = (l + <span class="number">16</span>) / <span class="number">116</span>
    x = y + (a / <span class="number">500</span>)
    z = y - (b / <span class="number">200</span>)

    <span class="keyword">if</span> x &gt; <span class="number">0.2068965517</span>
      x = x * x * x
    <span class="keyword">else</span>
      x = <span class="number">0.1284185493</span> * (x - <span class="number">0.1379310345</span>)
  
    <span class="keyword">if</span> y &gt; <span class="number">0.2068965517</span>
      y = y * y * y
    <span class="keyword">else</span>
      y = <span class="number">0.1284185493</span> * (y - <span class="number">0.1379310345</span>)
  
    <span class="keyword">if</span> z &gt; <span class="number">0.2068965517</span>
      z = z * z * z
    <span class="keyword">else</span>
      z = <span class="number">0.1284185493</span> * (z - <span class="number">0.1379310345</span>)</pre></div></div>
            
        </li>
        
        
        <li id="section-12">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-12">&#182;</a>
              </div>
              <p>D65 reference white point</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>    x: x * <span class="number">95.047</span>, y: y * <span class="number">100.0</span>, z: z * <span class="number">108.883</span></pre></div></div>
            
        </li>
        
        
        <li id="section-13">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-13">&#182;</a>
              </div>
              <p>Converts L<em>, a</em>, b* back to RGB values.</p>
<p>@see Convert.rgbToXYZ
@see Convert.xyzToLab</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  <span class="property">@rgbToLab</span>: (r, g, b) -&gt;
    <span class="keyword">if</span> <span class="keyword">typeof</span> r <span class="keyword">is</span> <span class="string">"object"</span>
      g = r.g
      b = r.b
      r = r.r
    
    xyz = <span class="property">@rgbToXYZ</span>(r, g, b)
    <span class="property">@xyzToLab</span> xyz

  <span class="property">@labToRGB</span>: (l, a, b) -&gt;
    
Convert = Caman.Convert</pre></div></div>
            
        </li>
        
    </ul>
  </div>
</body>
</html>
